<?php
/*
 *author:museany
 *
 */
namespace app\socket\controller;
use \GatewayWorker\Lib\Gateway;
use \Workerman\Lib\Timer;
use app\socket\controller\Wsroom;
use think\Db;
use think\Cache;
use extend\org;
require_once __DIR__ .'/Wsroom.php';
class Wsevents

{
	public static $tmp;
	/**
	 * 有消息时
	 * @param int $client_id
	 * @param mixed $message
	 */
	public static function onMessage($client_id, $message)
	{
		$message_data = $message;//json_decode($message, true);
		if(!$message_data){return ;}
		Wsroom::onmessage($client_id, $message_data);
		//默认房间1
	}
	/**
	 * 当客户端断开连接时
	 * @param integer $client_id 客户端id
	 */
	public static function onConnect($client_id)
	{
		Wsroom::onConnect($client_id);
	}
	/**
	 * 当客户端开始时
	 * @param integer $client_id 客户端id
	 */
	public static function onWorkerStart($client_id)
	{
		Wsroom::onWorkerStart($client_id);
	}
	/**
	 * 当客户端断开连接时
	 * @param integer $client_id 客户端id
	 */
	public static function onClose($client_id)
	{

		Wsroom::onClose($client_id);  
	}
}

